import request from '../../../components/Request';

export async function listCategory() {
  let result = await request.post({
    url: './common/listCategory.do',
    data: { type: 2 },
  });
  return result.data;
}


export async function listCfg(pageNo, pageSize, categoryId, name) {
  let result = await request.post({
    url: './cfg/listCfg.do',
    data: { pageNo: pageNo, pageSize: pageSize, categoryId: categoryId, name: name },
  });
  return result.data;
}

export async function saveCfg(cfg) {
  let result = await request.post({
    url: './cfg/saveCfg.do',
    data: cfg,
  });
  return result;
}

export async function deleteCfg(cfg) {
  await request.post({
    url: './cfg/deleteCfg.do',
    data: cfg,
  });
}
